package org.etom.impl.ui.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipInputStream;

/**
 * The helper class. The eclipse API automatically close the stream.
 * The behavior is made compatible for the zip input stream.
 */
public class ProjectFileZipInputStream extends ZipInputStream {

  /**
   * Constructs the new stream.
   * @param in - the input stream
   */
  public ProjectFileZipInputStream(InputStream in) {
    super(in);
  }

  /**
   * @see java.util.zip.ZipInputStream#close()
   */
  @Override
  public void close() throws IOException {
    closeEntry();//when the eclipse closes the stream, we close the entry 
  }
  
  /**
   * The method closes the whole stream.
   * 
   * @throws IOException - if the stream can not closed.
   */
  public void closeStream() throws IOException {
    close();
  }
  
}
